<?php
DEFINE("V_FL_CHECA_ACESSO", 2);
include ($DOCUMENT_ROOT."/../lib/config.inc.php3");
include ($CLASS_Validation);

$obj_ecValidation = new ecValidation;
if ($obj_ecValidation->sel_Estip("$v_f_cod_epl", "$v_f_nom_epl",
                                  "$v_f_descricao_estipulante")) {
    $r_cod_epl         = $obj_ecValidation->r_cod_epl;
    $r_nom_epl       = $obj_ecValidation->r_nom_epl;
    $r_descricao_estipulante  = $obj_ecValidation->r_descricao_estipulante;
    $r_total_estipulantes     = $obj_ecValidation->r_total;
} else {
    $msg = "Erro ao listar estipulantes: <br><b>";
    $msg .= $obj_ecValidation->error_msg . "</b>";
    $msg = urleconde ( $msg );
    Header ("Location: adminu_msgs.php?msg=$msg");
    exit;
}

?>
<html>
<head>
<title>::::: Gama Sa&uacute;de</title>
<link rel="STYLESHEET" type="text/css" href="css/default.css">
<link rel="STYLESHEET" type="text/css" href="css/top.css">
<link rel="STYLESHEET" type="text/css" href="css/menu.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" src="js/validation.js"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>

<body bgcolor="#ececec" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="750" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="images/int_back.gif">
  <tr>
    <td height="113" valign="top">
      <?include "inc_top.htm";?>
    </td>
  </tr>
  <tr>
    <td valign="top">
      <table width="750" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="images/top2_01.gif" width="187" height="105"></td>
          <td><img src="images/top2_02.gif" width="203" height="105"></td>
          <td><img src="images/tit_gama_saude.gif" width="360" height="105"></td>
        </tr>
      </table>
      <table width="750" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="187" valign="top">
            <?include "inc_men_empcliente.htm";?>
          </td>
          <td valign="top"><br>
            <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="font-padrao">
                   <tr>
                   <td width="291" valign="middle"><p align="right" class="nv2titulo">Usu&aacute;rios</p></td>
                   </tr>
            </table>
            <form action="adminu_usuarios_cadastrar_exec.php3" method="post" name="frmCadastroUsuarios" id="frmCadastroUsuarios">
                  <table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
                         <tr>
                             <td bgcolor="#FFFFFF"><span class="nv2subtitulo">Cadastrar Usu&aacute;rio </span><br><br>
                                 <table width="100%" border="0" cellpadding="2" cellspacing="1">
                                        <tr bgcolor="#ececec" class="font-tabela">
                                            <td width="142">Nome</td>
                                            <td width="405"><input name="v_nome_usuario" type="text" id="v_nome_usuario" size="50" maxlength="100"></td>
                                        </tr>
                                        <tr bgcolor="#ececec" class="font-tabela">
                                            <td>Login</td>
                                            <td><input name="v_login_usuario" type="text" id="v_login_usuario" size="30" maxlength="20"></td>
                                        </tr>
                                        <tr bgcolor="#ececec" class="font-tabela">
                                            <td>Senha</td>
                                            <td><input name="v_senha_usuario" type="password" id="v_senha_usuario" size="30" maxlength="20"></td>
                                        </tr>
                                        <tr bgcolor="#ececec" class="font-tabela">
                                            <td>Todos os Estipulantes: </td>
                                            <td><input name="v_fl_todos_estipulantes" type="radio" value="1" onClick="JavaScript: frmCadastroUsuarios.v_cod_epl.disabled=true;frmCadastroUsuarios.v_cod_epl.value=''">
                                            Sim
                                            <input name="v_fl_todos_estipulantes" type="radio" value="0" checked  onClick="JavaScript: frmCadastroUsuarios.v_cod_epl.disabled=false">
                                            N&atilde;o</td>
                                        </tr>
                                        <tr bgcolor="#ececec" class="font-tabela">
                                            <td>Estipulante</td>
                                            <td>
                                                <select name="v_cod_epl" id="v_cod_epl" class="boxSized1">
                                                        <option value="" selected>Selecione um Estipulante</option>
                                                        <?php $i=0;
                                                        while ($i < $r_total_estipulantes) { ?>
                                                        <option value="<?php echo $r_cod_epl[$i]; ?>"><?php echo $r_nom_epl[$i]; ?></option>
                                                        <? $i++; } ?>
                                                </select>
                                            </td>
                                        </tr>
                                        <?php if (V_USER_MASTER == 1) { ?>
                                        <tr bgcolor="#ececec" class="font-tabela">
                                            <td>Administrador</td>
                                            <td><input name="v_fl_adminsitrador" type="checkbox" id="v_fl_adminsitrador" value="1"></td>
                                        </tr>
                                        <?php } else { ?>
                                        <input name="v_fl_adminsitrador" type="hidden" id="v_fl_adminsitrador" value="0">
                                        <? } ?>
                                 </table>
                             </td>
                         </tr>
                         <tr>
                             <td valign="top">
                                 <table width="100%"  border="0" cellspacing="0" cellpadding="2">
                                        <tr>
                                            <td width="50%"><div align="right">
                                                <input name="v_id_usuario" type="hidden" id="v_id_usuario" value="<?php echo $r_id_usuario[0]; ?>">
                                                <input type="button" name="Button" value="Cancelar" onClick="JavaScript: history.back(-1);">
                                            </div></td>
                                            <td width="50%"><input type="submit" name="Submit" value="Cadastar" onClick="return checkForm(frmCadastroUsuarios);"></td>
                                        </tr>
                                 </table>
                             </td>
                         </tr>
                  </table>
            </form>
          <p>&nbsp;</p>
          </td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td height="48" valign="bottom"><img src="images/bot_01.gif" width="750" height="48"></td>
  </tr>
</table>
</body>
</html>
